﻿@{
    ViewBag.Title = "Template";
    Layout = "~/Views/Shared/_Page.cshtml";
}

<link href="/CSS/cosmic.css" rel="stylesheet" type="text/css" />

<h2>Load Template</h2>

<div id="cosmic_main"> </div>

@Html.Partial("~/Views/Shared/_Template.cshtml")

<script type="text/javascript">
    $(document).ready(function () {
        // data
        var comics = [
            {
                imgSrc: "/Images/cover1.jpg",
                title: "美国队长",
                year: "2010",
                number: "1"
            },
            {
                imgSrc: "/Images/cover2.jpg",
                title: "复仇者联盟",
                year: "2012",
                number: "2"
            },
            {
                imgSrc: "/Images/cat.jpg",
                title: "小猫传奇&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
                year: "2013",
                number: "3"
            }
        ];

        // use template
        $('#my-cosmic-view').tmpl(comics).appendTo('#cosmic_main');
    });
</script>





